let marbleRaceLevel7_8 = {
	name: 'Game 7 Level 8',
	comment:'过关奖5分',
	id: '7_8',
	type: 'value',
	valueIncrement:-1,
	valueBonus:5,
	scoreBonus:1,
	valueThreshold:0,
	minPass:1,
	objects: [
		// Portals
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			toPortal: 'a',
			x: 290,
			y: 200,
			width: 420,
			height: 20
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@b',
			toPortal: 'b',
			x: 390,
			y: 365,
			width: 420,
			height: 20
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@c',
			toPortal: 'c',
			x: 290,
			y: 540 - 10,
			width: 420,
			height: 20
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@goal',
			toPortal: 'goal',
			isGoal: true,
			x: 600 - 50,
			y: 540 - 10,
			width: 100,
			height: 20
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@a',
			portalID: 'a',
			x: 120,
			y: 80,
			radius: 5
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@b',
			portalID: 'b',
			x: 560,
			y: 240,
			radius: 5
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@c',
			portalID: 'c',
			x: 120,
			y: 400,
			radius: 5
		},

		// Goal portal
		{
			type: 'object',
			shape: 'circle',
			color: '@goal',
			portalID: 'goal',
			x: 700,
			y: 80,
			radius: 5
		},

		// Obstacles

		// Borders
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 0,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 600,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 0,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 800,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 640,
			y: 300,
			width: 80,
			height: 600
		},

		// Marbles
		{
			type: 'marbles',
			x: 180,
			y: 80,
			launchTime: 3,
			launchRadius: 75,
			passX: 700,
			passY: 80,
			radius: 8,
			eliminatedRadius: 6,
			velocity: 5
		},
	]
}
{
	let cntI = 2
	for (let i = 0; i <= cntI; ++i) {
		for (let j = 0; j < 9; ++j) {
			let x0 = 100 + j * 50
			if (j >= 5)
				x0 += 10
			if (i & 1)
				x0 = 680 - x0
			let y0 = 180 + i * 160
			let omega = 3
			if(i&1)
			omega=-omega
			marbleRaceLevel7_8.objects.push({
				type: 'object',
				shape: 'polygon',
				color: '@secondary',
				x: x0,
				y: y0,
				vertices: [
					{ x: 40, y: 5 }, { x: 5, y: 5 }, { x: 5, y: 40 },
					{ x: -5, y: 40 }, { x: -5, y: 5 }, { x: -40, y: 5 },
					{ x: -40, y: -5 }, { x: -5, y: -5 }, { x: -5, y: -40 },
					{ x: 5, y: -40 }, { x: 5, y: -5 }, { x: 40, y: -5 }
				],
				onBeforeUpdate: function (object, engine) {
					engine.setAngle(object.body, omega * engine.time)
				}
			})
		}
	}
}
marbleRaceLevels.push(marbleRaceLevel7_8)